<?xml version="1.0" encoding="ascii"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>psychsim.world.World</title>
  <link rel="stylesheet" href="epydoc.css" type="text/css" />
  <script type="text/javascript" src="epydoc.js"></script>
</head>

<body bgcolor="white" text="black" link="blue" vlink="#204080"
      alink="#204080">
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">
  <!-- Home link -->
      <th bgcolor="#70b0f0" class="navbar-select"
          >&nbsp;&nbsp;&nbsp;Home&nbsp;&nbsp;&nbsp;</th>

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Project homepage -->
      <th class="navbar" align="right" width="100%">
        <table border="0" cellpadding="0" cellspacing="0">
          <tr><th class="navbar" align="center"
            ><a class="navbar" target="_top" href="http://pynadath.net:81/projects/psychsim">PsychSim</a></th>
          </tr></table></th>
  </tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0">
  <tr valign="top">
    <td width="100%">
      <span class="breadcrumbs">
        <a href="psychsim-module.html">Package&nbsp;psychsim</a> ::
        <a href="psychsim.world-module.html">Module&nbsp;world</a> ::
        Class&nbsp;World
      </span>
    </td>
    <td>
      <table cellpadding="0" cellspacing="0">
        <!-- hide/show private -->
        <tr><td align="right"><span class="options">[<a href="javascript:void(0);" class="privatelink"
    onclick="toggle_private();">hide&nbsp;private</a>]</span></td></tr>
        <tr><td align="right"><span class="options"
            >[<a href="frames.html" target="_top">frames</a
            >]&nbsp;|&nbsp;<a href="psychsim.world.World-class.html"
            target="_top">no&nbsp;frames</a>]</span></td></tr>
      </table>
    </td>
  </tr>
</table>
<!-- ==================== CLASS DESCRIPTION ==================== -->
<h1 class="epydoc">Class World</h1><p class="nomargin-top"><span class="codelink"><a href="psychsim.world-pysrc.html#World">source&nbsp;code</a></span></p>
<!-- ==================== INSTANCE METHODS ==================== -->
<a name="section-InstanceMethods"></a>
<table class="summary" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td colspan="2" class="table-header">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr valign="top">
        <td align="left"><span class="table-header">Instance Methods</span></td>
        <td align="right" valign="top"
         ><span class="options">[<a href="#section-InstanceMethods"
         class="privatelink" onclick="toggle_private();"
         >hide private</a>]</span></td>
      </tr>
    </table>
  </td>
</tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="psychsim.world.World-class.html#__init__" class="summary-sig-name">__init__</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">xml</span>=<span class="summary-sig-default">None</span>)</span></td>
          <td align="right" valign="top">
            <span class="codelink"><a href="psychsim.world-pysrc.html#World.__init__">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a name="initialize"></a><span class="summary-sig-name">initialize</span>(<span class="summary-sig-arg">self</span>)</span></td>
          <td align="right" valign="top">
            <span class="codelink"><a href="psychsim.world-pysrc.html#World.initialize">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="psychsim.world.World-class.html#step" class="summary-sig-name">step</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">actions</span>=<span class="summary-sig-default">None</span>,
        <span class="summary-sig-arg">state</span>=<span class="summary-sig-default">None</span>,
        <span class="summary-sig-arg">real</span>=<span class="summary-sig-default">True</span>)</span><br />
      The simulation method</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="psychsim.world-pysrc.html#World.step">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a name="stepFromState"></a><span class="summary-sig-name">stepFromState</span>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">vector</span>,
        <span class="summary-sig-arg">actions</span>=<span class="summary-sig-default">None</span>,
        <span class="summary-sig-arg">horizon</span>=<span class="summary-sig-default">None</span>,
        <span class="summary-sig-arg">tiebreak</span>=<span class="summary-sig-default">None</span>)</span><br />
      Compute the resulting states when starting in a given possible world 
      (as opposed to a distribution over possible worlds)</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="psychsim.world-pysrc.html#World.stepFromState">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="psychsim.world.World-class.html#effect" class="summary-sig-name">effect</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">actions</span>,
        <span class="summary-sig-arg">vector</span>,
        <span class="summary-sig-arg">probability</span>=<span class="summary-sig-default">1.0</span>)</span></td>
          <td align="right" valign="top">
            <span class="codelink"><a href="psychsim.world-pysrc.html#World.effect">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a name="deltaState"></a><span class="summary-sig-name">deltaState</span>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">actions</span>,
        <span class="summary-sig-arg">vector</span>,
        <span class="summary-sig-arg">keys</span>=<span class="summary-sig-default">None</span>)</span><br />
      Computes the change across a subset of state features</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="psychsim.world-pysrc.html#World.deltaState">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a name="addTermination"></a><span class="summary-sig-name">addTermination</span>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">tree</span>)</span><br />
      Adds a possible termination condition to the list</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="psychsim.world-pysrc.html#World.addTermination">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">bool</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="psychsim.world.World-class.html#terminated" class="summary-sig-name">terminated</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">state</span>=<span class="summary-sig-default">None</span>)</span><br />
      Evaluates world states with respect to termination conditions</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="psychsim.world-pysrc.html#World.terminated">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a name="addAgent"></a><span class="summary-sig-name">addAgent</span>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">agent</span>)</span></td>
          <td align="right" valign="top">
            <span class="codelink"><a href="psychsim.world-pysrc.html#World.addAgent">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="psychsim.world.World-class.html#setDynamics" class="summary-sig-name">setDynamics</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">entity</span>,
        <span class="summary-sig-arg">feature</span>,
        <span class="summary-sig-arg">action</span>,
        <span class="summary-sig-arg">tree</span>,
        <span class="summary-sig-arg">enforceMin</span>=<span class="summary-sig-default">False</span>,
        <span class="summary-sig-arg">enforceMax</span>=<span class="summary-sig-default">False</span>)</span><br />
      Defines the effect of an action on a given state feature</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="psychsim.world-pysrc.html#World.setDynamics">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a name="getDynamics"></a><span class="summary-sig-name">getDynamics</span>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">key</span>,
        <span class="summary-sig-arg">action</span>)</span></td>
          <td align="right" valign="top">
            <span class="codelink"><a href="psychsim.world-pysrc.html#World.getDynamics">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="psychsim.world.World-class.html#addDependency" class="summary-sig-name">addDependency</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">dependent</span>,
        <span class="summary-sig-arg">independent</span>)</span><br />
      Adds a dependency between the dependent key and the independent key, 
      indicating that the new value for the independent key should be 
      determined first</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="psychsim.world-pysrc.html#World.addDependency">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="psychsim.world.World-class.html#setOrder" class="summary-sig-name">setOrder</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">order</span>)</span><br />
      Initializes the turn order to the given order</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="psychsim.world-pysrc.html#World.setOrder">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">str[]</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="psychsim.world.World-class.html#next" class="summary-sig-name">next</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">vector</span>=<span class="summary-sig-default">None</span>)</span><br />
      Returns:
      a list of agents (by name) whose turn it is in the current epoch</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="psychsim.world-pysrc.html#World.next">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="psychsim.world.World-class.html#deltaOrder" class="summary-sig-name">deltaOrder</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">actions</span>,
        <span class="summary-sig-arg">vector</span>)</span><br />
      Returns:
      the new turn sequence resulting from the performance of the given 
      actions</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="psychsim.world-pysrc.html#World.deltaOrder">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">set(<a href="psychsim.action.ActionSet-class.html" 
      class="link">ActionSet</a>)</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="psychsim.world.World-class.html#getActions" class="summary-sig-name">getActions</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">vector</span>,
        <span class="summary-sig-arg">agents</span>=<span class="summary-sig-default">None</span>,
        <span class="summary-sig-arg">actions</span>=<span class="summary-sig-default">None</span>)</span><br />
      Returns:
      the set of all possible action combinations that could happen in the 
      given state</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="psychsim.world-pysrc.html#World.getActions">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="psychsim.world.World-class.html#defineState" class="summary-sig-name">defineState</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">entity</span>,
        <span class="summary-sig-arg">feature</span>,
        <span class="summary-sig-arg">domain</span>=<span class="summary-sig-default">&lt;type 'float'&gt;</span>,
        <span class="summary-sig-arg">lo</span>=<span class="summary-sig-default">0.0</span>,
        <span class="summary-sig-arg">hi</span>=<span class="summary-sig-default">1.0</span>,
        <span class="summary-sig-arg">description</span>=<span class="summary-sig-default">None</span>)</span><br />
      Define a state feature in this world</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="psychsim.world-pysrc.html#World.defineState">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="psychsim.world.World-class.html#setState" class="summary-sig-name">setState</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">entity</span>,
        <span class="summary-sig-arg">feature</span>,
        <span class="summary-sig-arg">value</span>)</span></td>
          <td align="right" valign="top">
            <span class="codelink"><a href="psychsim.world-pysrc.html#World.setState">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type"><a href="psychsim.probability.Distribution-class.html" 
      class="link">Distribution</a></span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="psychsim.world.World-class.html#getState" class="summary-sig-name">getState</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">entity</span>,
        <span class="summary-sig-arg">feature</span>,
        <span class="summary-sig-arg">state</span>=<span class="summary-sig-default">None</span>)</span><br />
      Returns:
      a distribution over values for the given feature</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="psychsim.world-pysrc.html#World.getState">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a name="getMentalModel"></a><span class="summary-sig-name">getMentalModel</span>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">modelee</span>,
        <span class="summary-sig-arg">vector</span>)</span></td>
          <td align="right" valign="top">
            <span class="codelink"><a href="psychsim.world-pysrc.html#World.getMentalModel">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a name="setMentalModel"></a><span class="summary-sig-name">setMentalModel</span>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">modeler</span>,
        <span class="summary-sig-arg">modelee</span>,
        <span class="summary-sig-arg">distribution</span>,
        <span class="summary-sig-arg">model</span>=<span class="summary-sig-default">True</span>)</span><br />
      Sets the distribution over mental models one agent has of another 
      entity</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="psychsim.world-pysrc.html#World.setMentalModel">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a name="updateModels"></a><span class="summary-sig-name">updateModels</span>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">outcome</span>,
        <span class="summary-sig-arg">vector</span>)</span></td>
          <td align="right" valign="top">
            <span class="codelink"><a href="psychsim.world-pysrc.html#World.updateModels">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type"><a href="psychsim.pwl.KeyedVector-class.html" 
      class="link">KeyedVector</a></span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="psychsim.world.World-class.html#scaleState" class="summary-sig-name">scaleState</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">vector</span>)</span><br />
      Normalizes the given state vector so that all elements occur in [0,1]</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="psychsim.world-pysrc.html#World.scaleState">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">KeyedVector&rarr;ActionSet&rarr;VectorDistribution</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="psychsim.world.World-class.html#reachable" class="summary-sig-name">reachable</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">vector</span>=<span class="summary-sig-default">None</span>,
        <span class="summary-sig-arg">transition</span>=<span class="summary-sig-default">None</span>,
        <span class="summary-sig-arg">horizon</span>=<span class="summary-sig-default">-1</span>,
        <span class="summary-sig-arg">ignore</span>=<span class="summary-sig-default"><code class="variable-group">[</code><code class="variable-group">]</code></span>)</span><br />
      Returns:
      transition matrix among states reachable from the given state 
      (default is current state)</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="psychsim.world-pysrc.html#World.reachable">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a name="nearestVector"></a><span class="summary-sig-name">nearestVector</span>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">vector</span>,
        <span class="summary-sig-arg">vectors</span>)</span></td>
          <td align="right" valign="top">
            <span class="codelink"><a href="psychsim.world-pysrc.html#World.nearestVector">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a name="getDescription"></a><span class="summary-sig-name">getDescription</span>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">entity</span>,
        <span class="summary-sig-arg">feature</span>)</span></td>
          <td align="right" valign="top">
            <span class="codelink"><a href="psychsim.world-pysrc.html#World.getDescription">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="psychsim.world.World-class.html#explain" class="summary-sig-name">explain</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">outcomes</span>,
        <span class="summary-sig-arg">level</span>=<span class="summary-sig-default">1</span>,
        <span class="summary-sig-arg">buf</span>=<span class="summary-sig-default">None</span>)</span><br />
      Generate a more readable interpretation of outcomes generated by <a 
      href="psychsim.world.World-class.html#step" class="link">step</a></td>
          <td align="right" valign="top">
            <span class="codelink"><a href="psychsim.world-pysrc.html#World.explain">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a name="explainAction"></a><span class="summary-sig-name">explainAction</span>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">outcome</span>,
        <span class="summary-sig-arg">buf</span>=<span class="summary-sig-default">None</span>,
        <span class="summary-sig-arg">level</span>=<span class="summary-sig-default">0</span>)</span></td>
          <td align="right" valign="top">
            <span class="codelink"><a href="psychsim.world-pysrc.html#World.explainAction">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a name="explainDecision"></a><span class="summary-sig-name">explainDecision</span>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">decision</span>,
        <span class="summary-sig-arg">buf</span>=<span class="summary-sig-default">None</span>,
        <span class="summary-sig-arg">level</span>=<span class="summary-sig-default">2</span>,
        <span class="summary-sig-arg">prefix</span>=<span class="summary-sig-default"><code class="variable-quote">'</code><code class="variable-string"></code><code class="variable-quote">'</code></span>)</span><br />
      Subroutine of <a href="psychsim.world.World-class.html#explain" 
      class="link">explain</a> for explaining agent decisions</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="psychsim.world-pysrc.html#World.explainDecision">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="psychsim.world.World-class.html#printState" class="summary-sig-name">printState</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">distribution</span>=<span class="summary-sig-default">None</span>,
        <span class="summary-sig-arg">buf</span>=<span class="summary-sig-default">None</span>,
        <span class="summary-sig-arg">prefix</span>=<span class="summary-sig-default"><code class="variable-quote">'</code><code class="variable-string"></code><code class="variable-quote">'</code></span>,
        <span class="summary-sig-arg">beliefs</span>=<span class="summary-sig-default">False</span>)</span><br />
      Utility method for displaying a distribution over possible worlds</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="psychsim.world-pysrc.html#World.printState">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="psychsim.world.World-class.html#printVector" class="summary-sig-name">printVector</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">vector</span>,
        <span class="summary-sig-arg">buf</span>=<span class="summary-sig-default">None</span>,
        <span class="summary-sig-arg">prefix</span>=<span class="summary-sig-default"><code class="variable-quote">'</code><code class="variable-string"></code><code class="variable-quote">'</code></span>,
        <span class="summary-sig-arg">first</span>=<span class="summary-sig-default">True</span>,
        <span class="summary-sig-arg">beliefs</span>=<span class="summary-sig-default">False</span>,
        <span class="summary-sig-arg">csv</span>=<span class="summary-sig-default">False</span>)</span><br />
      Utility method for displaying a single possible world</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="psychsim.world-pysrc.html#World.printVector">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a name="printDelta"></a><span class="summary-sig-name">printDelta</span>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">old</span>,
        <span class="summary-sig-arg">new</span>,
        <span class="summary-sig-arg">buf</span>=<span class="summary-sig-default">None</span>,
        <span class="summary-sig-arg">prefix</span>=<span class="summary-sig-default"><code class="variable-quote">'</code><code class="variable-string"></code><code class="variable-quote">'</code></span>)</span></td>
          <td align="right" valign="top">
            <span class="codelink"><a href="psychsim.world-pysrc.html#World.printDelta">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a name="__xml__"></a><span class="summary-sig-name">__xml__</span>(<span class="summary-sig-arg">self</span>)</span></td>
          <td align="right" valign="top">
            <span class="codelink"><a href="psychsim.world-pysrc.html#World.__xml__">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a name="parse"></a><span class="summary-sig-name">parse</span>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">element</span>)</span></td>
          <td align="right" valign="top">
            <span class="codelink"><a href="psychsim.world-pysrc.html#World.parse">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">str</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="psychsim.world.World-class.html#save" class="summary-sig-name">save</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">filename</span>,
        <span class="summary-sig-arg">compressed</span>=<span class="summary-sig-default">True</span>)</span><br />
      Returns:
      the filename used (possibly with a .psy extension added)</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="psychsim.world-pysrc.html#World.save">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
</table>
<!-- ==================== CLASS VARIABLES ==================== -->
<a name="section-ClassVariables"></a>
<table class="summary" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td colspan="2" class="table-header">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr valign="top">
        <td align="left"><span class="table-header">Class Variables</span></td>
        <td align="right" valign="top"
         ><span class="options">[<a href="#section-ClassVariables"
         class="privatelink" onclick="toggle_private();"
         >hide private</a>]</span></td>
      </tr>
    </table>
  </td>
</tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a name="__NORMALIZE__"></a><span class="summary-name">__NORMALIZE__</span> = <code title="False">False</code>
    </td>
  </tr>
</table>
<!-- ==================== INSTANCE VARIABLES ==================== -->
<a name="section-InstanceVariables"></a>
<table class="summary" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td colspan="2" class="table-header">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr valign="top">
        <td align="left"><span class="table-header">Instance Variables</span></td>
        <td align="right" valign="top"
         ><span class="options">[<a href="#section-InstanceVariables"
         class="privatelink" onclick="toggle_private();"
         >hide private</a>]</span></td>
      </tr>
    </table>
  </td>
</tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">str&rarr;<a href="psychsim.agent.Agent-class.html" 
      class="link">Agent</a></span>
    </td><td class="summary">
        <a name="agents"></a><span class="summary-name">agents</span><br />
      table of agents in this world, indexed by name
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">dict</span>
    </td><td class="summary">
        <a name="dependency"></a><span class="summary-name">dependency</span><br />
      table of dependencies among state features that impose temporal 
      constraints
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">dict</span>
    </td><td class="summary">
        <a name="dynamics"></a><span class="summary-name">dynamics</span><br />
      table of action effect models
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">dict</span>
    </td><td class="summary">
        <a name="features"></a><span class="summary-name">features</span><br />
      definitions of state features, over agents and the world itself
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">list</span>
    </td><td class="summary">
        <a name="history"></a><span class="summary-name">history</span><br />
      accumulated list of outcomes from simulation steps
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type"><a href="psychsim.pwl.VectorDistribution-class.html" 
      class="link">VectorDistribution</a></span>
    </td><td class="summary">
        <a name="state"></a><span class="summary-name">state</span><br />
      the distribution over states of the world
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">str&rarr;int</span>
    </td><td class="summary">
        <a name="symbols"></a><span class="summary-name">symbols</span><br />
      utility storage of symbols used across all enumerated state features
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type"><a href="psychsim.pwl.KeyedTree-class.html" 
      class="link">KeyedTree</a>[]</span>
    </td><td class="summary">
        <a name="termination"></a><span class="summary-name">termination</span><br />
      list of conditions under which the simulation terminates (default is 
      none)
    </td>
  </tr>
</table>
<!-- ==================== METHOD DETAILS ==================== -->
<a name="section-MethodDetails"></a>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td colspan="2" class="table-header">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr valign="top">
        <td align="left"><span class="table-header">Method Details</span></td>
        <td align="right" valign="top"
         ><span class="options">[<a href="#section-MethodDetails"
         class="privatelink" onclick="toggle_private();"
         >hide private</a>]</span></td>
      </tr>
    </table>
  </td>
</tr>
</table>
<a name="__init__"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">__init__</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">xml</span>=<span class="sig-default">None</span>)</span>
    <br /><em class="fname">(Constructor)</em>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="psychsim.world-pysrc.html#World.__init__">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>xml</code></strong> (Node or str) - Initialization argument, either an XML Element, or a filename</li>
    </ul></dd>
  </dl>
</td></tr></table>
</div>
<a name="step"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">step</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">actions</span>=<span class="sig-default">None</span>,
        <span class="sig-arg">state</span>=<span class="sig-default">None</span>,
        <span class="sig-arg">real</span>=<span class="sig-default">True</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="psychsim.world-pysrc.html#World.step">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>The simulation method</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>actions</code></strong> (str&rarr;<a href="psychsim.action.ActionSet-class.html" 
          class="link">ActionSet</a>) - optional argument setting a subset of actions to be performed in 
          this turn</li>
        <li><strong class="pname"><code>state</code></strong> (<a href="psychsim.pwl.VectorDistribution-class.html" 
          class="link">VectorDistribution</a>) - optional initial state distribution (default is the current world
          state distribution)</li>
        <li><strong class="pname"><code>real</code></strong> (bool) - if <code>True</code>, then modify the given state; otherwise, 
          this is only hypothetical (default is <code>True</code>)</li>
    </ul></dd>
  </dl>
</td></tr></table>
</div>
<a name="effect"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">effect</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">actions</span>,
        <span class="sig-arg">vector</span>,
        <span class="sig-arg">probability</span>=<span class="sig-default">1.0</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="psychsim.world-pysrc.html#World.effect">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>probability</code></strong> (float) - the likelihood of this particular action set (default is 100%)</li>
    </ul></dd>
  </dl>
</td></tr></table>
</div>
<a name="terminated"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">terminated</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">state</span>=<span class="sig-default">None</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="psychsim.world-pysrc.html#World.terminated">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Evaluates world states with respect to termination conditions</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>state</code></strong> (<a href="psychsim.pwl.KeyedVector-class.html" 
          class="link">KeyedVector</a> or <a 
          href="psychsim.pwl.VectorDistribution-class.html" 
          class="link">VectorDistribution</a>) - the state vector (or distribution thereof) to evaluate (default 
          is the current world state)</li>
    </ul></dd>
    <dt>Returns: bool</dt>
        <dd><code>True</code> iff the given state (or all possible worlds if 
          a distribution) satisfies at least one termination condition</dd>
  </dl>
</td></tr></table>
</div>
<a name="setDynamics"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">setDynamics</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">entity</span>,
        <span class="sig-arg">feature</span>,
        <span class="sig-arg">action</span>,
        <span class="sig-arg">tree</span>,
        <span class="sig-arg">enforceMin</span>=<span class="sig-default">False</span>,
        <span class="sig-arg">enforceMax</span>=<span class="sig-default">False</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="psychsim.world-pysrc.html#World.setDynamics">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Defines the effect of an action on a given state feature</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>entity</code></strong> (str) - the entity whose state feature is affected (<code>None</code> if 
          on the world itself)</li>
        <li><strong class="pname"><code>feature</code></strong> (str) - the name of the affected state feature</li>
        <li><strong class="pname"><code>action</code></strong> (<a href="psychsim.action.Action-class.html" 
          class="link">Action</a> or <a 
          href="psychsim.action.ActionSet-class.html" 
          class="link">ActionSet</a>) - the action affecting the state feature</li>
        <li><strong class="pname"><code>tree</code></strong> (<a href="psychsim.pwl.KeyedTree-class.html" 
          class="link">KeyedTree</a>) - the decision tree defining the effect</li>
    </ul></dd>
  </dl>
</td></tr></table>
</div>
<a name="addDependency"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">addDependency</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">dependent</span>,
        <span class="sig-arg">independent</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="psychsim.world-pysrc.html#World.addDependency">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Adds a dependency between the dependent key and the independent key, 
  indicating that the new value for the independent key should be 
  determined first</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>dependent</code></strong> (str)</li>
        <li><strong class="pname"><code>independent</code></strong> (str)</li>
    </ul></dd>
  </dl>
</td></tr></table>
</div>
<a name="setOrder"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">setOrder</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">order</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="psychsim.world-pysrc.html#World.setOrder">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Initializes the turn order to the given order</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>order</code></strong> (str[] or {str}[]) - the turn order, as a list of names (each agent acts in sequence) 
          or a list of sets of names (agents within a set acts in parallel)</li>
    </ul></dd>
  </dl>
</td></tr></table>
</div>
<a name="next"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">next</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">vector</span>=<span class="sig-default">None</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="psychsim.world-pysrc.html#World.next">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  
  <dl class="fields">
    <dt>Returns: str[]</dt>
        <dd>a list of agents (by name) whose turn it is in the current epoch</dd>
  </dl>
</td></tr></table>
</div>
<a name="deltaOrder"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">deltaOrder</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">actions</span>,
        <span class="sig-arg">vector</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="psychsim.world-pysrc.html#World.deltaOrder">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  
  <dl class="fields">
    <dt>Returns:</dt>
        <dd>the new turn sequence resulting from the performance of the given
          actions</dd>
  </dl>
</td></tr></table>
</div>
<a name="getActions"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">getActions</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">vector</span>,
        <span class="sig-arg">agents</span>=<span class="sig-default">None</span>,
        <span class="sig-arg">actions</span>=<span class="sig-default">None</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="psychsim.world-pysrc.html#World.getActions">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  
  <dl class="fields">
    <dt>Returns: set(<a href="psychsim.action.ActionSet-class.html" 
      class="link">ActionSet</a>)</dt>
        <dd>the set of all possible action combinations that could happen in 
          the given state</dd>
  </dl>
</td></tr></table>
</div>
<a name="defineState"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">defineState</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">entity</span>,
        <span class="sig-arg">feature</span>,
        <span class="sig-arg">domain</span>=<span class="sig-default">&lt;type 'float'&gt;</span>,
        <span class="sig-arg">lo</span>=<span class="sig-default">0.0</span>,
        <span class="sig-arg">hi</span>=<span class="sig-default">1.0</span>,
        <span class="sig-arg">description</span>=<span class="sig-default">None</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="psychsim.world-pysrc.html#World.defineState">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Define a state feature in this world</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>entity</code></strong> (str) - the name of the entity this feature pertains to 
          (<code>None</code> if feature is on the world itself)</li>
        <li><strong class="pname"><code>feature</code></strong> (str) - the name of this new state feature</li>
        <li><strong class="pname"><code>domain</code></strong> (class) - the domain of values for this feature. Acceptable values are:
          <ul>
            <li>
              float: continuous range
            </li>
            <li>
              int: discrete numeric range
            </li>
            <li>
              bool: True/False value
            </li>
            <li>
              list: enumerated set of discrete values
            </li>
          </ul></li>
        <li><strong class="pname"><code>lo</code></strong> (float/int/list) - for float/int features, the lowest possible value. for list 
          features, a list of possible values.</li>
        <li><strong class="pname"><code>hi</code></strong> (float/int) - for float/int features, the highest possible value</li>
        <li><strong class="pname"><code>description</code></strong> (str) - optional text description explaining what this state feature 
          means</li>
    </ul></dd>
  </dl>
</td></tr></table>
</div>
<a name="setState"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">setState</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">entity</span>,
        <span class="sig-arg">feature</span>,
        <span class="sig-arg">value</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="psychsim.world-pysrc.html#World.setState">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>entity</code></strong> (str) - the name of the entity whose state feature we're setting (does 
          not have to be an agent)</li>
        <li><strong class="pname"><code>feature</code></strong> (str)</li>
        <li><strong class="pname"><code>value</code></strong> (float or <a href="psychsim.probability.Distribution-class.html" 
          class="link">Distribution</a>)</li>
    </ul></dd>
  </dl>
</td></tr></table>
</div>
<a name="getState"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">getState</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">entity</span>,
        <span class="sig-arg">feature</span>,
        <span class="sig-arg">state</span>=<span class="sig-default">None</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="psychsim.world-pysrc.html#World.getState">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>entity</code></strong> (str) - the name of the entity of interest (<code>None</code> if the 
          feature of interest is of the world itself)</li>
        <li><strong class="pname"><code>feature</code></strong> (str) - the state feature of interest</li>
        <li><strong class="pname"><code>state</code></strong> (<a href="psychsim.pwl.VectorDistribution-class.html" 
          class="link">VectorDistribution</a>) - the distribution over possible worlds (default is the current 
          world state)</li>
    </ul></dd>
    <dt>Returns: <a href="psychsim.probability.Distribution-class.html" 
      class="link">Distribution</a></dt>
        <dd>a distribution over values for the given feature</dd>
  </dl>
</td></tr></table>
</div>
<a name="scaleState"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">scaleState</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">vector</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="psychsim.world-pysrc.html#World.scaleState">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Normalizes the given state vector so that all elements occur in 
  [0,1]</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>vector</code></strong> (<a href="psychsim.pwl.KeyedVector-class.html" 
          class="link">KeyedVector</a>) - the vector to normalize</li>
    </ul></dd>
    <dt>Returns: <a href="psychsim.pwl.KeyedVector-class.html" 
      class="link">KeyedVector</a></dt>
        <dd>the normalized vector</dd>
  </dl>
</td></tr></table>
</div>
<a name="reachable"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">reachable</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">vector</span>=<span class="sig-default">None</span>,
        <span class="sig-arg">transition</span>=<span class="sig-default">None</span>,
        <span class="sig-arg">horizon</span>=<span class="sig-default">-1</span>,
        <span class="sig-arg">ignore</span>=<span class="sig-default"><code class="variable-group">[</code><code class="variable-group">]</code></span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="psychsim.world-pysrc.html#World.reachable">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  
  <dl class="fields">
    <dt>Returns: KeyedVector&rarr;ActionSet&rarr;VectorDistribution</dt>
        <dd>transition matrix among states reachable from the given state 
          (default is current state)</dd>
  </dl>
</td></tr></table>
</div>
<a name="explain"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">explain</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">outcomes</span>,
        <span class="sig-arg">level</span>=<span class="sig-default">1</span>,
        <span class="sig-arg">buf</span>=<span class="sig-default">None</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="psychsim.world-pysrc.html#World.explain">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Generate a more readable interpretation of outcomes generated by <a 
  href="psychsim.world.World-class.html#step" class="link">step</a></p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>outcomes</code></strong> (dict[]) - the return value from <a 
          href="psychsim.world.World-class.html#step" class="link">step</a></li>
        <li><strong class="pname"><code>level</code></strong> (int) - the level of explanation detail:
          <ol start="0">
            <li>
              No explanation
            </li>
            <li>
              Agent decisions
            </li>
            <li>
              Agent value functions
            </li>
            <li>
              Agent expectations
            </li>
            <li>
              Effects of expected actions
            </li>
            <li>
              World state (possibly subjective) at each step
            </li>
          </ol></li>
        <li><strong class="pname"><code>buf</code></strong> - the string buffer to put the explanation into (default is 
          standard out)</li>
    </ul></dd>
  </dl>
</td></tr></table>
</div>
<a name="printState"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">printState</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">distribution</span>=<span class="sig-default">None</span>,
        <span class="sig-arg">buf</span>=<span class="sig-default">None</span>,
        <span class="sig-arg">prefix</span>=<span class="sig-default"><code class="variable-quote">'</code><code class="variable-string"></code><code class="variable-quote">'</code></span>,
        <span class="sig-arg">beliefs</span>=<span class="sig-default">False</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="psychsim.world-pysrc.html#World.printState">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Utility method for displaying a distribution over possible worlds</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>buf</code></strong> - the string buffer to put the string representation in (default is
          standard output)</li>
        <li><strong class="pname"><code>prefix</code></strong> (str) - a string prefix (e.g., tabs) to insert at the beginning of each 
          line</li>
        <li><strong class="pname"><code>beliefs</code></strong> (True) - if <code>True</code>, print out inaccurate beliefs, too</li>
        <li><strong class="pname"><code>distribution</code></strong> (<a href="psychsim.pwl.VectorDistribution-class.html" 
          class="link">VectorDistribution</a>)</li>
    </ul></dd>
  </dl>
</td></tr></table>
</div>
<a name="printVector"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">printVector</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">vector</span>,
        <span class="sig-arg">buf</span>=<span class="sig-default">None</span>,
        <span class="sig-arg">prefix</span>=<span class="sig-default"><code class="variable-quote">'</code><code class="variable-string"></code><code class="variable-quote">'</code></span>,
        <span class="sig-arg">first</span>=<span class="sig-default">True</span>,
        <span class="sig-arg">beliefs</span>=<span class="sig-default">False</span>,
        <span class="sig-arg">csv</span>=<span class="sig-default">False</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="psychsim.world-pysrc.html#World.printVector">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Utility method for displaying a single possible world</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>buf</code></strong> - the string buffer to put the string representation in (default is
          standard output)</li>
        <li><strong class="pname"><code>prefix</code></strong> (str) - a string prefix (e.g., tabs) to insert at the beginning of each 
          line</li>
        <li><strong class="pname"><code>first</code></strong> (bool) - if <code>True</code>, then the first line is the continuation of 
          an existing line (default is <code>True</code>)</li>
        <li><strong class="pname"><code>csv</code></strong> (bool) - if <code>True</code>, then print the vector as comma-separated 
          values (default is <code>False</code>)</li>
        <li><strong class="pname"><code>vector</code></strong> (<a href="psychsim.pwl.KeyedVector-class.html" 
          class="link">KeyedVector</a>)</li>
    </ul></dd>
  </dl>
</td></tr></table>
</div>
<a name="save"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">save</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">filename</span>,
        <span class="sig-arg">compressed</span>=<span class="sig-default">True</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="psychsim.world-pysrc.html#World.save">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>compressed</code></strong> (bool) - if <code>True</code>, then save in compressed XML; otherwise, 
          save in XML (default is <code>True</code>)</li>
    </ul></dd>
    <dt>Returns: str</dt>
        <dd>the filename used (possibly with a .psy extension added)</dd>
  </dl>
</td></tr></table>
</div>
<br />
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">
  <!-- Home link -->
      <th bgcolor="#70b0f0" class="navbar-select"
          >&nbsp;&nbsp;&nbsp;Home&nbsp;&nbsp;&nbsp;</th>

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Project homepage -->
      <th class="navbar" align="right" width="100%">
        <table border="0" cellpadding="0" cellspacing="0">
          <tr><th class="navbar" align="center"
            ><a class="navbar" target="_top" href="http://pynadath.net:81/projects/psychsim">PsychSim</a></th>
          </tr></table></th>
  </tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
  <tr>
    <td align="left" class="footer">
    Generated by Epydoc 3.0.1 on Wed Oct 24 21:38:10 2012
    </td>
    <td align="right" class="footer">
      <a target="mainFrame" href="http://epydoc.sourceforge.net"
        >http://epydoc.sourceforge.net</a>
    </td>
  </tr>
</table>

<script type="text/javascript">
  <!--
  // Private objects are initially displayed (because if
  // javascript is turned off then we want them to be
  // visible); but by default, we want to hide them.  So hide
  // them unless we have a cookie that says to show them.
  checkCookie();
  // -->
</script>
</body>
</html>
